import 'package:flutter_cwhisky/bean/good_entity.dart';
import 'package:flutter_cwhisky/generated/json/base/json_convert_content.dart';
import 'package:flutter_cwhisky/bean/good_list_entity.dart';

GoodListEntity $GoodListEntityFromJson(Map<String, dynamic> json) {
	final GoodListEntity goodListEntity = GoodListEntity();
	final String? code = jsonConvert.convert<String>(json['code']);
	if (code != null) {
		goodListEntity.code = code;
	}
	final String? message = jsonConvert.convert<String>(json['message']);
	if (message != null) {
		goodListEntity.message = message;
	}
	final GoodListData? data = jsonConvert.convert<GoodListData>(json['data']);
	if (data != null) {
		goodListEntity.data = data;
	}

	final int? currentTime = jsonConvert.convert<int>(json['currentTime']);
	if (currentTime != null) {
		goodListEntity.currentTime = currentTime;
	}
	return goodListEntity;
}

Map<String, dynamic> $GoodListEntityToJson(GoodListEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['message'] = entity.message;
	data['data'] = entity.data?.toJson();
	data['currentTime'] = entity.currentTime;
	return data;
}

GoodListData $GoodListDataFromJson(Map<String, dynamic> json) {
	final GoodListData goodListData = GoodListData();
	final int? total = jsonConvert.convert<int>(json['total']);
	if (total != null) {
		goodListData.total = total;
	}
	final int? size = jsonConvert.convert<int>(json['size']);
	if (size != null) {
		goodListData.size = size;
	}
	final int? pages = jsonConvert.convert<int>(json['pages']);
	if (pages != null) {
		goodListData.pages = pages;
	}
	final int? current = jsonConvert.convert<int>(json['current']);
	if (current != null) {
		goodListData.current = current;
	}
	final bool? prev = jsonConvert.convert<bool>(json['prev']);
	if (prev != null) {
		goodListData.prev = prev;
	}
	final bool? next = jsonConvert.convert<bool>(json['next']);
	if (next != null) {
		goodListData.next = next;
	}
	final List<GoodEntity>? records = jsonConvert.convertListNotNull<GoodEntity>(json['records']);
	if (records != null) {
		goodListData.records = records;
	}
	final String? subImage = jsonConvert.convert<String>(json['subImage']);
	if (subImage != null) {
		goodListData.subImage = subImage;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		goodListData.name = name;
	}
	final String? colorStart = jsonConvert.convert<String>(json['colorStart']);
	if (colorStart != null) {
		goodListData.colorStart = colorStart;
	}
	final String? colorEnd = jsonConvert.convert<String>(json['colorEnd']);
	if (colorEnd != null) {
		goodListData.colorEnd = colorEnd;
	}
	return goodListData;
}

Map<String, dynamic> $GoodListDataToJson(GoodListData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['total'] = entity.total;
	data['size'] = entity.size;
	data['pages'] = entity.pages;
	data['current'] = entity.current;
	data['prev'] = entity.prev;
	data['next'] = entity.next;
	data['records'] =  entity.records?.map((v) => v.toJson()).toList();
	data['subImage'] = entity.subImage;
	data['name'] = entity.name;
	data['colorStart'] = entity.colorStart;
	data['colorEnd'] = entity.colorEnd;
	return data;
}







